import "./App.css"
import { BrowserRouter, Switch, Route, Redirect } from "react-router-dom"
import Search from "./page/Search"
import Layout from "./page/Layout"
import SearchResult from "./page/Search/searchResult"
import Login from "./page/Login"
import ProfileEdit from "./components/ProfileEdit"
import ArticleDetail from "./components/ArticleDetail"
import Dynamic from "./page/Dynamic"
import Follow from "./page/Follow"
import Collect from "./page/Collect"
import History from "./page/History"
import Feedback from "./page/Feedback"
import Intellect from "./page/Intellect"
function App() {
  return (
    <div className="App">
      <BrowserRouter initialEntries={["/home"]}>
        <Switch>
          <Route exact path="/" render={() => <Redirect to="/home" />} />
          <Route path="/home" component={Layout}></Route>
          <Route exact path="/search" component={Search}></Route>
          <Route exact path="/searchResult" component={SearchResult}></Route>
          <Route exact path="/login" component={Login}></Route>
          <Route exact path="/profile/edit" component={ProfileEdit}></Route>
          <Route path="/articleDetail/:id" component={ArticleDetail}></Route>
          <Route path="/user/dynamic" component={Dynamic}></Route>
          <Route path="/user/follow/:text" component={Follow}></Route>
          <Route path="/user/collect" component={Collect}></Route>
          <Route path="/user/history" component={History}></Route>
          <Route path="/user/feedback" component={Feedback}></Route>
          <Route path="/intellect" component={Intellect}></Route>
        </Switch>
      </BrowserRouter>
    </div>
  )
}

export default App
